<script lang="ts" setup>
defineOptions({
	name: 'test_TestBase64Upload'
})

const cover = ref('')

const logCover = () => {
	console.log(cover.value)
}

const uploadCover = () => {
	Tool.blobToBase64(cover.value).then(base64 => {
		const formParams = { base64 }
		Api.post('/other/file/upload-by-base64', formParams).then(res => {
			console.log(res)
		})
	})
}
</script>

<template>
	<IsGuest>
		<add-cover v-model="cover"></add-cover>
		<a-button @click="logCover">logCover</a-button>
		<a-button @click="uploadCover">uploadCover</a-button>
	</IsGuest>
</template>

<style scoped></style>
